package selectionSort;

import java.util.Random;

public class ArrayGenerator {
    public static Integer[] generateOrderedArray(int n){
        Integer [] arr = new Integer[n];
        for (int i = 0; i < n; i++) {
            arr[i] = i;
        }
        return arr;
    }


    //生成n个数据[0,bound)的乱序数组。
    public static Integer[] generateRandomArray(int n, int bound) {
        Integer[] arr = new Integer[n];
        Random rnd = new Random();
        for (int i = 0; i < n; i++)
            arr[i] = rnd.nextInt(bound);
        return arr ;
    }
    //生成n个数据[0,bound)的乱序数组。
    public static int[] generateIntRandomArray(int n, int bound) {
        int[] arr = new int[n];
        Random rnd = new Random();
        for (int i = 0; i < n; i++)
            arr[i] = rnd.nextInt(bound);
        return arr ;
    }
}
